#!/bin/sh
cd `dirname $0`
DEFAULT_CONFIG_FILE="/mnt/FunKey/.config/gmu/gmu.conf"
while true; do
	# 运行应用程序
	if [ -f ${DEFAULT_CONFIG_FILE} ]; then
		SDL_NOMOUSE=1 ./gmu -c ${DEFAULT_CONFIG_FILE}
	else
		SDL_NOMOUSE=1 ./gmu -c gmu.funkey.conf
	fi
    
	# 检查退出状态码,30是表示重新启动
	if [ $? -eq 30 ]; then
		echo "Restarting myapp..."
	else
		echo "Exiting loop"
		break
	fi
done
